"""gma URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URL conf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""

from django.conf.urls import url
from django.conf.urls import include
from django.views.decorators.csrf import csrf_exempt

from apps.api import views
from apps.mp import views as mp_views

urlpatterns = [
    url(r'^pipe/', include(('apps.api.urls_pipe', 'apps.api'), namespace='pipe')),

    # ------------------------------------------------------------------------------
    # Basic
    # ------------------------------------------------------------------------------
    # 获取验证码
    url(r'^fetch_sms_code/$', csrf_exempt(views.api_fetch_smscode), name='api_fetch_smscode'),
    # 获取验证码
    url(r'^fetch_token/$', csrf_exempt(views.api_fetch_token), name='api_fetch_token'),

    # ------------------------------------------------------------------------------
    # 公众号充值
    # ------------------------------------------------------------------------------

    # 查询用户信息
    url(r'^pay/user_info/$', csrf_exempt(views.api_user_info), name='api_user_info'),
    # 获取公众号充值的预支付信息
    url(r'^pay/mp_prepay/$', csrf_exempt(mp_views.api_get_prepay_info), name='api_get_hb_mp_prepay_info'),

    # ------------------------------------------------------------------------------
    # 提现(灵猴)
    # ------------------------------------------------------------------------------

    # 获取用户充值提现信息
    url(r'^withdraw/user_info/$', csrf_exempt(views.api_withdraw_user_info), name='api_withdraw_user_info'),
    # 信息认证
    url(r'^withdraw/person_auth/$', csrf_exempt(views.api_withdraw_person_auth), name='api_withdraw_person_auth'),
    # 计算手续费
    url(r'^withdraw/fee/$', csrf_exempt(views.api_withdraw_fee), name='api_withdraw_fee'),
    # 提现
    url(r'^withdraw/submit/$', csrf_exempt(views.api_withdraw_submit), name='api_withdraw_submit'),

    # ------------------------------------------------------------------------------
    # 圣诞活动
    # ------------------------------------------------------------------------------

    # 获取圣诞活动信息
    url(r'^christmas/info/$', csrf_exempt(views.api_christmas_info), name='api_christmas_info'),
    # 开启圣诞宝箱
    url(r'^christmas/open_box/$', csrf_exempt(views.api_christmas_open_box), name='api_christmas_open_box'),
    # 获取圣诞礼品列表
    url(r'^christmas/log/$', csrf_exempt(views.api_christmas_log), name='api_christmas_log'),

    # ------------------------------------------------------------------------------
    # 春节活动
    # ------------------------------------------------------------------------------

    # 新年签到活动信息
    url(r'^cny/info/$', csrf_exempt(views.api_cny_sign_info), name='api_cny_sign_info'),
    # 新年签到
    url(r'^cny/sign/$', csrf_exempt(views.api_cny_sign), name='api_cny_sign'),
    # 烟火房间榜
    url(r'^cny/ranking/rooms/$', csrf_exempt(views.api_cny_room_rankings), name='api_cny_room_rankings'),
    # 烟火个人榜
    url(r'^cny/ranking/consume/$', csrf_exempt(views.api_cny_consume_rankings), name='api_cny_consume_rankings'),

    # ------------------------------------------------------------------------------
    # 实名认证
    # ------------------------------------------------------------------------------

    # 查询用户信息
    url(r'^auth/user_info/$', csrf_exempt(views.api_user_auth_info), name='api_user_auth_info'),
    # 获取上传图片的token
    url(r'^auth/fetch_qiniu_token/$', csrf_exempt(views.api_fetch_qiniu_upload_token), name='api_fetch_qiniu_upload_token'),
    # 上传认证资料
    url(r'^auth/upload/$', csrf_exempt(views.api_upload_identity_info), name='api_upload_identity_info'),
    # 支付宝身份认证
    url(r'^auth/alipay/certify/$', csrf_exempt(views.api_alipay_certify), name='api_alipay_certify'),
    # 支付宝身份认证结果查询
    url(r'^auth/alipay/query/$', csrf_exempt(views.api_alipay_certify_query), name='api_alipay_certify_query'),

    # ------------------------------------------------------------------------------
    # 人气周星榜
    # ------------------------------------------------------------------------------

    # 获取人气周星榜活动信息请求
    url(r'^star/info/$', csrf_exempt(views.api_weekly_star_info), name='api_weekly_star_info'),
    # 周星活动的人气榜
    url(r'^star/ranking/income/$', csrf_exempt(views.api_weekly_star_income_ranking), name='api_weekly_star_income_ranking'),
    # 周星活动的贡献榜
    url(r'^star/ranking/consume/$', csrf_exempt(views.api_weekly_star_consume_ranking), name='api_weekly_star_consume_ranking'),
    # 关注用户
    url(r'^user/follow/$', csrf_exempt(views.api_follow_user), name='api_follow_user'),

    # ------------------------------------------------------------------------------
    # 幸运转盘活动
    # ------------------------------------------------------------------------------

    # 幸运转盘活动信息
    url(r'^spin/info/$', csrf_exempt(views.api_lucky_spin_info), name='api_lucky_spin_info'),
    # 获取抽奖记录
    url(r'^spin/logs/$', csrf_exempt(views.api_lucky_spin_logs), name='api_lucky_spin_logs'),
    # 抽奖
    url(r'^spin/play/$', csrf_exempt(views.api_lucky_spin_play), name='api_lucky_spin_play'),

    # ------------------------------------------------------------------------------
    # 首充活动
    # ------------------------------------------------------------------------------

    # 首充活动信息
    url(r'^first_pay/info/$', csrf_exempt(views.api_first_pay_info), name='api_first_pay_info'),
    # 首充活动领奖
    url(r'^first_pay/collect/$', csrf_exempt(views.api_first_pay_collect), name='api_first_pay_collect'),

    # ------------------------------------------------------------------------------
    # 累充活动
    # ------------------------------------------------------------------------------

    # 累充活动信息
    url(r'^total_pay/info/$', csrf_exempt(views.api_total_pay_info), name='api_total_pay_info'),
    # 累充活动领奖
    url(r'^total_pay/collect/$', csrf_exempt(views.api_total_pay_collect), name='api_total_pay_collect'),

    # ------------------------------------------------------------------------------
    # 五一活动
    # ------------------------------------------------------------------------------

    # 最强公会榜
    url(r'^202051/ranking/rooms/$', csrf_exempt(views.api_labor_day_room_ranking), name='api_labor_day_room_ranking'),
    # 至尊富豪榜
    url(r'^202051/ranking/consume/$', csrf_exempt(views.api_labor_consume_ranking), name='api_labor_consume_ranking'),
]
